<div id="data_page" class="in_page">
	<div class="panel panel-default">
		      <button type="button" id="sub" class="btn btn-sm  btn-primary fBtn">新增未注册的管理员</button>

</div>
      <table class="table table-bordered" style="text-align:center">
        <thead>
          <tr>
           <!--  <th><span class="glyphicon glyphicon-leaf"></span>ID</th> -->
            <th><span class="glyphicon glyphicon-leaf"></span>客服姓名</th>
            <th><span class="glyphicon glyphicon-leaf"></span>手机号</th>
            <th><span class="glyphicon glyphicon-leaf"></span>性别</th>
            <th><span class="glyphicon glyphicon-leaf"></span>操作</th>
          </tr>     
        </thead>
        <tbody>
         <volist name="list['list']" id="data">
          <tr>
          <!--   <td>{$data['id']}</td> -->
            <td>{$data['username']}</td>
            <td>{$data['phone']}</td>
            <td><if condition="$data['sex'] eq '0'">男</if><if condition="$data['sex'] eq '1'">女</if></td>
            <td>
               <div class="btn-group" role="group" aria-label="...">
               	<if condition="$data['id'] neq '1'"><a href="{:U('Customer/del_usre',array('id'=>$data['id']))}"><button type="button"  class="btn btn-danger btn-xs">删除</button></a></if>
               <button type="button"  class="btn btn-group btn-xs del_kf"  did="{$data['id']}">清除客服绑定信息</button>
                  <a href="{:U('Customer/sc_up',array('id'=>$data['id']))}"><button type="button"  class="btn btn-primary btn-xs">修改客服的服务中心</button></a>
                  
                
               </div>
           </td>
          </tr>
        </volist>
        </tbody>
      </table> 
</div>
<div class="pagelist">{$list['page']} </div>
<style>
 .pagelist{ text-align:right; background:#f1f1f1; padding:7px 0;}
  .pagelist a{ margin:0 5px; border:#6185a2 solid 1px; display:inline-block; padding:2px 6px 1px; line-height:16px; background:#fff; color:#6185a2;}
 .pagelist span{ margin:0 5px; border:#6185a2 solid 1px; display:inline-block; padding:2px 6px 1px; line-height:16px; color:#6185a2; color:#fff; background:#6185a2;}
 .trr td{height: 50px; line-height: 50px}

</style> 

<div class="modal" id="addnewModal">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
     
      </div>
      <div class="modal-body">
      <form class="form-horizontal">
		  <div class="form-group">
		    <label for="inputKey" class="col-sm-2 control-label">姓名</label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" id="name" name="name" required="required" >
		    </div>
		    <label for="inputKey" class="col-sm-2 control-label">手机号</label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" id="phone" name="phone"  required="required">
		    </div>
		    
		  </div>
		  </form>
      </div>
      <div class="modal-footer">
      	<button type="button" id="close" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" id="submit" class="btn btn-primary" data-dismiss="modal">保存</button>
      
      </div>
    </div>
  </div>
</div>

<script type="text/javascript">
	
	$("#submit").click(function(){
		data={
			name:$("#name").val(),
			phone:$("#phone").val(),
		}
		if($("#name").val()=="" || $("#phone").val()==""){
			alert("姓名和手机号不能为空");
			return false;
		}
		
		$.get("http://sunwayuchoice.com/admin.php/Customer/add_old_manger",data,function(obj){
			if(obj.s=="ok"){
				$("#addnewModal").hide();
				alert(obj.m);
			}
			if(obj.s=="no"){
				$("#addnewModal").hide();
				alert(obj.m);
			}
			if(obj.s!="ok" && obj.s!="no"){
				alert("添加失败");
			}
		
			
		});
		
	});
	$(".del_kf").click(function(){
		
		var id=$(this).attr('did');
		
		var url="{:U('Customer/del_kf')}?id="+id;
		$.get(url,function(obj){	
				alert(obj.info);	
		});
		
	});







	$(function(){
		$("#addnewModal").hide();
	});
	$("#sub").click(function(){
		$("#addnewModal").show();
	});
	$("#close").click(function(){
		$("#addnewModal").hide();
	});
//	$("#saveBtn").click(function(){
//		var Url2=document.getElementById("inputKey");
//		Url2.select("inputKey"); // 选择对象
//		document.execCommand("Copy"); // 执行浏览器复制命令  
//		alert("已复制好，可贴粘。");
//	});
</script>